package com.springboot.fluentmybatis.entity;

import cn.org.atool.fluent.mybatis.annotation.FluentMybatis;
import cn.org.atool.fluent.mybatis.annotation.TableField;
import cn.org.atool.fluent.mybatis.annotation.TableId;
import cn.org.atool.fluent.mybatis.base.IEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@FluentMybatis(table = "t_user")
public class User implements IEntity {

    @TableId("id")
    private Integer id;

    @TableField("name")
    private String name;

    @TableField("age")
    private Integer age;

    @TableField("email")
    private String email;

    @TableField(value = "gmt_create", insert = "now()")
    private LocalDateTime gmtCreate;

    @TableField(value = "gmt_modified", insert = "now()")
    private LocalDateTime gmtModified;

    @TableField(insert = "0", value = "is_deleted")
    private Boolean isDeleted;

}
